feat(queue): backend queue state machine replacing frontend shuffle, navigation, and play-next logic#42
Merged
Conversation
…navigation, and play-next logic Move ~500 lines of queue state machine from JS frontend to Rust backend. Frontend queue store becomes a thin reactive layer calling backend commands and applying returned state snapshots. Backend: - Extend queue_state table with play_next_offset, play_history_json, play_next_track_ids_json, repeat_one_pending columns - Add toggle_shuffle (Fisher-Yates with play-next pinning), add_play_next (move semantics + offset tracking), advance_to_next/previous (repeat-one two-phase, loop modes, history), skip_to_next/previous (override repeat-one), check_integrity - Register 6 new Tauri commands, enhance queue_set_shuffle to return QueueStateSnapshot - 773 Rust tests pass Frontend: - Remove _shuffleItems, _reshuffleForLoopRestart, _originalOrder, _playHistory, _playNextTrackIds, _playNextOffset, _repeatOnePending, _syncQueueToBackend, _validateQueueIntegrity - Add _applySnapshot and _applyNavigationResult - Update queue-builder and queue.props tests for backend-delegated pattern - 444 Vitest tests pass Closes TASK-328 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unnecessary async from _applyNavigationResult (no await inside). Prefix unused fromNavigation parameter with underscore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
toggleShuffle now sets this.shuffle before the backend call (like cycleLoop does for loop mode), reverting on failure. Add aria-pressed to the shuffle button so the E2E accessibility test detects state change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queue_add_play_next,queue_play_next_track,queue_play_previous_track,queue_skip_next,queue_skip_previous,queue_check_integrityqueue_stateDB table withplay_next_offset,play_history_json,play_next_track_ids_json,repeat_one_pendingcolumnsTest plan
cargo nextest run -p mt-tauri— 773 tests passnpx vitest run— 444 tests passCloses TASK-328
🤖 Generated with Claude Code